textview: Set handles' mode to "none" if showing the bubble
authorCarlos Garnacho <carlosg@gnome.org>
Fri, 12 Jun 2015 11:04:45 +0000 (13:04 +0200)
committerCarlos Garnacho <carlosg@gnome.org>
Fri, 12 Jun 2015 11:04:45 +0000 (13:04 +0200)
show_or_hide_handles() tries to disable visibility when the popover is
shown, although it triggers a bit late, and lets the handles flash briefly
if both popover and handles try to show at the same time (eg. when
pressing on the selection of a previously unfocused textview, the handles
were previously hidden, so they try to show again on focus in).

gtk/gtktextview.c

index 29d0648ba8266aeef0b5f83a06be24a0fcc1f027..997a633685feba464b728a40631f2dd9ba2a8a80 100644 (file)
@@ -5284,11 +5284,15 @@ gtk_text_view_multipress_gesture_pressed (GtkGestureMultiPress *gesture,
                   {
                     if (!priv->selection_bubble ||
                        !gtk_widget_get_visible (priv->selection_bubble))
-                      gtk_text_view_selection_bubble_popup_set (text_view);
+                      {
+                        gtk_text_view_selection_bubble_popup_set (text_view);
+                        handle_mode = GTK_TEXT_HANDLE_MODE_NONE;
+                      }
                     else
-                      gtk_text_view_selection_bubble_popup_unset (text_view);
-
-                    handle_mode = GTK_TEXT_HANDLE_MODE_SELECTION;
+                      {
+                        gtk_text_view_selection_bubble_popup_unset (text_view);
+                        handle_mode = GTK_TEXT_HANDLE_MODE_SELECTION;
+                      }
                   }
                 else
                   {